package site.zbox.tool.swing;

import site.zbox.tool.lang.Version;

@Version("2012-11-15")
public class Margin {
    public static final Margin M_8_8_8_8_8 = new Margin(8);
    public static final Margin M_0_0_0_0_0 = new Margin(0);
    public static final Margin M_0_0_0_0_8 = new Margin(0, 0, 8);
    public static final Margin M_0_8_8_8_8 = new Margin(0, 8, 8, 8, 8);

    public final int center;
    public final int top;
    public final int left;
    public final int bottom;
    public final int right;

    public Margin(int top, int bottom, int left, int right, int center) {
        this.top = top;
        this.left = left;
        this.bottom = bottom;
        this.right = right;
        this.center = center;
    }

    public Margin(int vertical, int horizontal, int center) {
        this(vertical, vertical, horizontal, horizontal, center);
    }

    public Margin(int border, int center) {
        this(border, border, center);
    }

    public Margin(int space) {
        this(space, space);
    }

    public Margin() {
        this(0);
    }
}
